The invention relates to a method and a generator for generating an orthogonal spreading code in a CDMA radio system, particularly a short orthogonal spreading code used for channelization.
In radio systems utilizing code division multiple access (CDMA), a radio resource is allocated to several different users on a code division basis. The payload of each user is spread on a broad frequency band, for example 5 MHz, by multiplying the payload by a spreading code. A receiver is able to separate a desired signal by multiplying the received signal by the spreading code used for the spreading. Parts of a spreading code are referred to as xe2x80x98chipsxe2x80x99, which are basically bits or binary numbers. The value of a chip can be denoted by xe2x80x98zeroxe2x80x99 and xe2x80x98onexe2x80x99, or by xe2x80x98onexe2x80x99 and xe2x80x98minus onexe2x80x99 in real numbers. The chip rate is typically considerably higher than the payload rate, for example it is more than 100-fold the payload rate.
xe2x80x98Spreading codexe2x80x99 refers to a short spreading code used for channelization and, for example, not to a considerably longer scrambling code used to identify a transmitter. The length of a spreading code is typically at most a few hundreds or thousands of chips, whereas the length of a scrambling code can be, for example, a few tens of thousands of chips.
The used spreading codes are as mutually orthogonal as possible. Spreading codes are obtained for example by a Hadamard matrix. Hadamard matrix Mn is an nxc3x97n matrix (n is an even integer) formed of zeros and ones, such that any matrix row differs from any other matrix row exactly in n/2 positions. One matrix row thus comprises only zeros and the other rows contain half zeros and half ones. When n=2, the following Hadamard matrix is obtained:                               M          2                =                  [                                                    0                                            0                                                                    0                                            1                                              ]                                    (        1        )            
Hadamard matrix Mn provides Hadamard matrix M2n with the following relation:                               M                      2            ⁢            n                          =                  [                                                                      M                  n                                                                              M                  n                                                                                                      M                  n                                                                                                  M                    _                                    n                                                              ]                                    (        2        )            
wherein matrix {overscore (M)}n refers to a complement of matrix Mn, i.e. zeros have been replaced with ones and ones with zeros. Matrix 1 thus provides                               M          4                =                  [                                                    0                                            0                                            0                                            0                                                                    0                                            1                                            0                                            1                                                                    0                                            0                                            1                                            1                                                                    0                                            1                                            1                                            0                                              ]                                    (        3        )            
Further, matrix 3 provides                               M          8                =                  [                                                    0                                            0                                            0                                            0                                            0                                            0                                            0                                            0                                                                    0                                            1                                            0                                            1                                            0                                            1                                            0                                            1                                                                    0                                            0                                            1                                            1                                            0                                            0                                            1                                            1                                                                    0                                            1                                            1                                            0                                            0                                            1                                            1                                            0                                                                    0                                            0                                            0                                            0                                            1                                            1                                            1                                            1                                                                    0                                            1                                            0                                            1                                            1                                            0                                            1                                            0                                                                    0                                            0                                            1                                            1                                            1                                            1                                            0                                            0                                                                    0                                            1                                            1                                            0                                            1                                            0                                            0                                            1                                              ]                                    (        4        )            
If the elements that are possible in the Hadamard matrices described above, i.e. zeros and ones, are denoted by xe2x80x981xe2x80x99 and xe2x80x98xe2x88x921xe2x80x99, the matrix rows are mutually orthogonal. The values could also be inverted, if desired, i.e. zeros replaced with ones and vice versa, but this does not change the properties of the matrix. For example matrix 1 could also be given in the following forms:             M              2        ⁢                  xe2x80x83                      =          [                                    1                                1                                                1                                0                              ]        ,            M      2        =          [                                    1                                1                                                1                                              -              1                                          ]      
Each matrix row forms one spreading code. The length of the spreading code depends on the desired spreading factor. The spreading codes can be numbered for example such that the code class of the spreading code is indicated together with the running number of the code in the code class in question. The code class can be solved from the following equation: 2 to the power of the code class=the length of the spreading code, i.e. the code class is a two-base logarithm of the spreading code. Thus, for example matrix 4 comprises the following spreading codes (the subscript describes the code class, and the running number is in parenthesis):
SPREADINGCODE3(0)={0,0,0,0,0,0,00}
SPREADINGCODE3(1)={0,1,0,1,0,1,0,1}
SPREADINGCODE3(2)={0,0,1,1,0,0,1,1}
SPREADINGCODE3(3)={0,1,1,0,0,1,1,0}
SPREADINGCODE3(4)={0,0,0,0,1,1,1,1}
SPREADINGCODE3(5)={0,1,0,1,1,0,1,0}
SPREADINGCODE3(6)={0,0,1,1,1,1,0,0}
SPREADINGCODE3(7)={0,1,1,0,1,0,0,1}
In the prior art all the short spreading codes are stored in a memory of a transceiver. For example in the case of a code in code class 8, there are 256 different 256-chip codes stored in the memory, i.e. memory is needed for 256xc3x97256 bits=altogether 65536 bits. Shorter spreading codes can be generated from the stored long codes, wherefore there is no need to separately store the spreading codes of the lower code classes.
An object of the invention is to develop a method of generating a spreading code when necessary, so that there is no need to store each spreading code in the memory. This is achieved with the method described below. This is a method of generating an orthogonal spreading code in a CDMA radio system, the method comprising steps of obtaining the length of the spreading code, obtaining the running number of the spreading code, obtaining the code class of the spreading code, denoting the running number of the spreading code in the code class in question by a binary code number of the same length as the code class, forming a modified code number by reversing the code number, repeating the following operations for each chip of the spreading code: denoting the running number of the chip by a binary chip number of the same length as the code class, and forming a binary sum with an AND operation between the modified code number and the chip number, and forming one value for the chip of the spreading code with an XOR operation between all the bits of the binary sum.
The invention also relates to a generator for an orthogonal spreading code in a CDMA radio system, comprising means for obtaining the length of the spreading code, means for obtaining the running number of the spreading code, means for obtaining the code class of the spreading code, means for denoting the running number of the spreading code in the code class in question by a binary code number of the same length as the code class, means for forming a modified code number by reversing the code number, means for repeating the following operations for each chip of the spreading code: means for denoting the running number of the chip by a binary chip number of the same length as the code class, and means for forming a binary sum with an AND operation between the modified code number and the chip number, and means for forming one value for the chip of the spreading code with an XOR operation between all the bits of the binary sum.
The preferred embodiments of the invention are disclosed in the dependent claims.
The invention is based on the idea that spreading codes are not stored but they are generated, whenever required, by means of an efficient calculation method described below.
The arrangement according to the invention saves memory considerably. Also, when the mathematical operations required are compared to the disclosed matrix operations, it can be said that the present method requires rather a little calculation power. Up to code class 8 the spreading codes can be generated by means of only about 100 to 200 combinational gates without the need for memory.